<template>
  <div>
    <div>
      <el-form :model="ruleForm"   class="demo-ruleForm">
        <el-form-item prop="username">
          <el-input v-model="ruleForm.username"></el-input>
        </el-form-item>
        <el-form-item prop="password">
          <el-input v-model="ruleForm.password"></el-input>
        </el-form-item>

        <el-form-item>
          <el-button type="primary" @click="add">登录</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ruleForm: {
        username: "",
        password: "",
      },
    };
  },
  methods: {
    add(){
        if(this.ruleForm.username == 'admin' && this.ruleForm.password == '123456'){
            this.$router.push('/farent')
        }else{
            alert('密码错误')
        }
    }
  },
};
</script>

<style scoped>
</style>